package vg.modules.opener.system;

import vg.services.data_base_manager.data.graph.Graph;

/**
 * This class ONLY example and shouldn't used.
 * This class generate simple graph
 *
 * @author dkolbin
 */

public class TemporaryPseudoLoad {
	/**
	 * This method create graph where each vertex connected with
	 * @param number - number vertex in graph
	 * @return generated graph
	 * @throws CoreException 
	 */
	public static Graph generate(int number) throws Exception {
/*		ArrayList<Vertex> v = new ArrayList<Vertex>();
		ArrayList<Edge> e = new ArrayList<Edge>();
		Vertex p1 = null;
		Vertex p2 = null;
		Vertex curr = null;
		int c = 0;
		
		for (int i = 0; i< number; i++,p2 = p1, p1 = curr) {
			curr = new Vertex();
			if (i == number -1 )
				curr.setInnerGraph(1);
			v.add(curr);
			if (p1 == null) 
				continue;
			e.add(new Edge(curr, p1,"e" + c));
			if (p2 == null)
				continue;
			e.add(new Edge(curr, p2, "e" + (c+1)));
			c += 2;
		}
		SubGraph sg1 = new SubGraph(null,v, e, true);
		
		ArrayList<Vertex> v2 = new ArrayList<Vertex>();
		ArrayList<Edge> e2 = new ArrayList<Edge>();
		
		Vertex t1 = new Vertex();
		v2.add(t1);
		Vertex t2 = new Vertex();
		v2.add(t2);
		e2.add(new Edge(t1, t2, "e"+c));
		SubGraph sg2 = new SubGraph(null,v2, e2, true);
		
		Graph g = new Graph();
		g.addSubGraph(0, sg1);
		g.addSubGraph(1, sg2);
		return g;*/
		return null;
	}
	public static Graph generate() throws Exception {
		return generate(100);
	}
}
